package my_interface

import (
	"fmt"
	"log"
	"os"
	"time"
)

const (
	Message_pic_info uint8 = 1
	Message_pic      uint8 = 2
	Message_new      uint8 = 3
	Message_led      uint8 = 4
)

func init() {
	fmt.Println("log init")
	log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
	t := time.Unix(time.Now().Unix(), 0).Format("2006-01-02")
	t = t + ".log"
	logFile, err := os.OpenFile(t, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
	if err != nil {
		log.Panic("打开日志文件异常")
	}
	log.SetOutput(logFile)
}
